home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 149 / cd-rom 149.iso / essenc / dotnet / prog01.exe / wcu / WPF / wpf.msi / Microsoft.WinFX_X86.targets < prev    next >
Encoding:
Extensible Markup Language  |  2006-10-20  |  44.7 KB  |  1,082 lines

  1. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  2.  
  3.   <PropertyGroup>
  4.  
  5.     <BuildSystem>MSBuild</BuildSystem>
  6.     <TaskVersion>3.0.0.0</TaskVersion>
  7.     <TaskKeyToken>31bf3856ad364e35</TaskKeyToken>
  8.     <BuildTaskAssembly Condition="'$(BuildTaskAssembly)'==''">PresentationBuildTasks, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</BuildTaskAssembly>
  9.  
  10.     <AlwaysCompileMarkupFilesInSeparateDomain Condition="'$(BuildingInsideVisualStudio)' == 'true' and '$(AlwaysCompileMarkupFilesInSeparateDomain)' == ''">true</AlwaysCompileMarkupFilesInSeparateDomain>
  11.  
  12.     <AlwaysCompileMarkupFilesInSeparateDomain Condition="'$(AlwaysCompileMarkupFilesInSeparateDomain)' == '' ">false</AlwaysCompileMarkupFilesInSeparateDomain>
  13.  
  14.     <LocalizationDirectivesToLocFile Condition="'$(LocalizationDirectivesToLocFile)' == ''">None</LocalizationDirectivesToLocFile>
  15.  
  16.     <GetFrameworkPathsDependsOn>
  17.         $(GetFrameworkPathsDependsOn);
  18.         GetWinFXPath
  19.     </GetFrameworkPathsDependsOn>
  20.  
  21.     <WinFXNativePath  Condition="'$(WinFXNativePath)' == ''">$(ProgramFiles)\Reference Assemblies\Microsoft\Framework\v3.0</WinFXNativePath>
  22.  
  23.     <WinFXWowPath Condition="'$(WinFXWowPath)' == ''">$(ProgramFiles)\Reference Assemblies\Microsoft\Framework\v3.0</WinFXWowPath>
  24.  
  25.   </PropertyGroup>
  26.  
  27.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.MarkupCompilePass1" AssemblyName="$(BuildTaskAssembly)" />
  28.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.UpdateManifestForBrowserApplication" AssemblyName="$(BuildTaskAssembly)" />
  29.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.UidManager" AssemblyName="$(BuildTaskAssembly)" />
  30.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.ResourcesGenerator" AssemblyName="$(BuildTaskAssembly)" />
  31.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.FileClassifier" AssemblyName="$(BuildTaskAssembly)" />
  32.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.MarkupCompilePass2" AssemblyName="$(BuildTaskAssembly)" />
  33.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly" AssemblyName="$(BuildTaskAssembly)" />
  34.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.MergeLocalizationDirectives" AssemblyName="$(BuildTaskAssembly)" />
  35.  
  36.   <UsingTask TaskName="Microsoft.Build.Tasks.Windows.GetWinFXPath" AssemblyName="$(BuildTaskAssembly)" />
  37.  
  38.   <Target Name="GetWinFXPath">
  39.  
  40.       <GetWinFXPath WinFXNativePath="$(WinFXNativePath)"
  41.                     WinFXWowPath="$(WinFXWowPath)" >
  42.  
  43.           <Output TaskParameter="WinFXPath" PropertyName="_WinFXAssemblyDirectory"/>
  44.           <Output TaskParameter="WinFXPath" PropertyName="WinFXAssemblyDirectory" Condition="'$(ReferenceWinFXAssemblyFromGAC)' != 'true' "/>
  45.  
  46.       </GetWinFXPath>
  47.  
  48.       <!--   Put WinFX Redist xml file into item type RedistList, so that
  49.              some CPU specific assemblies can be filtered out by ClickOnce
  50.              manifest generation task.
  51.       -->
  52.  
  53.       <CreateItem Include="$(_WinFXAssemblyDirectory)\WinFXList.xml">
  54.             <Output TaskParameter="Include" ItemName="RedistList" />
  55.       </CreateItem>
  56.  
  57.   </Target>
  58.  
  59.  
  60.  
  61.  
  62.  
  63.   <!-- Some Default Settings -->
  64.   <PropertyGroup>
  65.  
  66.       <!-- 
  67.           XamlDebuggingInformation property controls whether or not to put line number information in the 
  68.           generated binary file for a Xaml markup file.
  69.  
  70.           If XamlDebuggingInformation is set in project file, take whatever setting.
  71.  
  72.       If XamlDebuggingInformation property is not explicitly set, and the current build is for debug,
  73.           Set true to XamlDebuggingInformation, if the build is not for Debug, keep the empty setting for
  74.           XamlDebuggingInformation, it means not to put line number information in the generated binary file.
  75.  
  76.       -->
  77.       <XamlDebuggingInformation Condition="'$(XamlDebuggingInformation)' == '' and '$(Configuration)' == 'Debug'">true</XamlDebuggingInformation>
  78.  
  79.  
  80.       <HostInBrowser Condition="'$(HostInBrowser)'==''">false</HostInBrowser>
  81.       <Version Condition="'$(Version)'==''">1.0.0.0</Version>
  82.       <DeploymentType Condition="'$(DeploymentType)'==''">Installed</DeploymentType>
  83.       <RunAfterInstall Condition="'$(RunAfterInstall)'==''">true</RunAfterInstall>
  84.       <ProcessorArchitecture Condition="'$(ProcessorArchitecture)'==''">$(PROCESSOR_ARCHITECTURE)</ProcessorArchitecture>
  85.       <GeneratedFileExtension>.g$(DefaultLanguageSourceExtension)</GeneratedFileExtension>
  86.  
  87.       <OSVersion Condition="'$(OSVersion)' == ''">5.1.2600.0</OSVersion>
  88.  
  89.       <!-- Initialize some Local-Type_Ref related properties -->
  90.       <_RequireMCPass2ForSatelliteAssemblyOnly>false</_RequireMCPass2ForSatelliteAssemblyOnly>
  91.       <_RequireMCPass2ForMainAssembly>false</_RequireMCPass2ForMainAssembly>
  92.  
  93.       <!--
  94.           If DebugType is set in project file, below properties should be
  95.           set already in Microsoft.Common.targets.
  96.           So set default values here when DebugType is not set in project file.
  97.       -->
  98.  
  99.       <DebugSymbols Condition="'$(DebugType)' == ''">true</DebugSymbols>
  100.       <_DebugSymbolsProduced Condition="'$(DebugType)' == ''">true</_DebugSymbolsProduced>
  101.       <DebugType Condition="'$(DebugType)' == ''" >pdbonly</DebugType>
  102.  
  103.   </PropertyGroup>
  104.  
  105.   <PropertyGroup>
  106.  
  107.       <IsApplication Condition="'$(OutputType)'=='exe'">true</IsApplication>
  108.       <IsApplication Condition="'$(OutputType)'=='winexe'">true</IsApplication>
  109.       <IsLibrary Condition="'$(OutputType)'=='library'">true</IsLibrary>
  110.       <IsLibrary Condition="'$(OutputType)'=='module'">true</IsLibrary>
  111.       
  112.   </PropertyGroup>
  113.  
  114.  
  115.   <PropertyGroup>
  116.  
  117.       <!-- 
  118.           Inject AssignWinFXEmbeddedResource target at right stage.
  119.       -->
  120.  
  121.       <PrepareResourceNamesDependsOn>
  122.                     AssignWinFXEmbeddedResource;
  123.                     $(PrepareResourceNamesDependsOn)
  124.       </PrepareResourceNamesDependsOn>
  125.  
  126.   </PropertyGroup>
  127.  
  128.  
  129.   <!-- Common Application and Library Property settings -->
  130.   <PropertyGroup>
  131.  
  132.       <PrepareResourcesDependsOn>
  133.                 MarkupCompilePass1;
  134.                 MarkupCompilePass2ForMainAssembly;
  135.                 FileClassification;
  136.                 MainResourcesGeneration;
  137.                 $(PrepareResourcesDependsOn)
  138.       </PrepareResourcesDependsOn>
  139.  
  140.   </PropertyGroup>
  141.  
  142.  
  143.   <PropertyGroup>
  144.         <!-- Add Markup compilation to the CoreCompileDependsOn so that the IDE inproc compilers (particularly VB)
  145.              can "see" the generated source files. -->
  146.  
  147.       <CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true' ">
  148.           DesignTimeMarkupCompilation;
  149.           $(CoreCompileDependsOn)
  150.       </CoreCompileDependsOn>
  151.       
  152.   </PropertyGroup>
  153.  
  154.   <Target Name="DesignTimeMarkupCompilation">
  155.  
  156.         <!-- Only if we are not actually performing a compile i.e. we are in design mode -->
  157.         <CallTarget Condition="'$(BuildingProject)' != 'true'"
  158.                 Targets="MarkupCompilePass1" />
  159.   </Target>
  160.  
  161.   <!-- 
  162.        Override GetFrameworkPaths in Microsoft.Common.targets to 
  163.        treat WinFX assemblies the same as CLR assemblies, so that 
  164.        they are not copied to the project's Output Path.
  165.   -->
  166.  
  167.     <Target
  168.         Name="GetFrameworkPaths"
  169.         DependsOnTargets="$(GetFrameworkPathsDependsOn)">
  170.  
  171.         <!-- Get the path to the target .NET framework directory. -->
  172.         <GetFrameworkPath>
  173.             <Output TaskParameter="Path" PropertyName="TargetFrameworkDirectory"/>
  174.             <Output TaskParameter="Path" ItemName="_TargetFrameworkDirectoryItem"/>
  175.         </GetFrameworkPath>
  176.  
  177.         <!-- Get the path to the target .NET framework SDK directory. -->
  178.         <GetFrameworkSDKPath>
  179.             <Output TaskParameter="Path" PropertyName="TargetFrameworkSDKDirectory"/>
  180.             <Output TaskParameter="Path" ItemName="_TargetFrameworkSDKDirectoryItem"/>
  181.         </GetFrameworkSDKPath>
  182.  
  183.         <!-- Adding WinFX path to the TargetFrameworkDirectory property -->
  184.  
  185.         <CreateProperty
  186.             Value="$(TargetFrameworkDirectory);$(CLR_REF_PATH);$(WinFXAssemblyDirectory)" >
  187.  
  188.             <Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory" />
  189.         </CreateProperty>
  190.  
  191.         <CreateItem Include="$(CLR_REF_PATH);$(WinFXAssemblyDirectory)" >
  192.            <Output ItemName="_TargetFrameworkDirectoryItem" TaskParameter="Include" />
  193.         </CreateItem>
  194.  
  195.         <Message Text="TargetFrameworkDirectory is $(TargetFrameworkDirectory)." Condition="'$(MSBUILDTargetsVerbose)' == 'true'" />
  196.  
  197.  
  198.     </Target>
  199.  
  200.  
  201.  
  202.     <!--  WinFX specific ItemGroup  -->
  203.  
  204.  
  205.     <ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
  206.  
  207.          <!-- 
  208.             Add WinFX specific Item names to AvailableItemName item, so that they can show up
  209.             in a drop-down menu for Build Action field of the properties window in VisualStudio.
  210.          --> 
  211.  
  212.          <AvailableItemName Include="ApplicationDefinition" />
  213.          <AvailableItemName Include="Page" />
  214.          <AvailableItemName Include="Resource" />
  215.  
  216.     </ItemGroup>
  217.  
  218.  
  219.   <!--   
  220.        Prepare Resource For SatelliteAssemblies.
  221.   -->
  222.  
  223.   <PropertyGroup Condition="'$(UICulture)' != ''" >
  224.       <PrepareResourcesForSatelliteAssembliesDependsOn>
  225.                SatelliteOnlyMarkupCompilePass2;
  226.                SatelliteResourceGeneration;
  227.                GenerateResourceWithCultureItem;
  228.       </PrepareResourcesForSatelliteAssembliesDependsOn>
  229.   </PropertyGroup>
  230.  
  231.  
  232.   <Target Name="PrepareResourcesForSatelliteAssemblies" 
  233.           Condition="'$(UICulture)' != ''" 
  234.           DependsOnTargets="$(PrepareResourcesForSatelliteAssembliesDependsOn)" >
  235.  
  236.   </Target>
  237.  
  238.  
  239.   <PropertyGroup>
  240.  
  241.     <!-- 
  242.          Hook up AfterCompileWinFX to that it runs
  243.          where AfterCompile would have run            
  244.     -->
  245.  
  246.     <CompileDependsOn>
  247.         $(CompileDependsOn);
  248.         _AfterCompileWinFXInternal
  249.     </CompileDependsOn>
  250.  
  251.  
  252.     <!-- 
  253.          Any targets that _AfterCompileWinFXInternal depends on.
  254.  
  255.          After the xaml file is compiled, the build system needs to generate a final .loc file
  256.          for localization support. MergeLocalizationDirectives target does this.
  257.  
  258.          
  259.          If UICulture is set, it needs to do below extra work before generating the .loc file:
  260.  
  261.              1. Calls the MarkupCompilePass2 for those xaml file which reference local types.
  262.              2. Generate the .resources for given culture from .baml and other resource files.
  263.  
  264.          Target PrepareResourcesForSatelliteAssemblies is for this.
  265.  
  266.     -->
  267.  
  268.     <_AfterCompileWinFXInternalDependsOn>
  269.         PrepareResourcesForSatelliteAssemblies;
  270.         MergeLocalizationDirectives;
  271.         AfterCompileWinFX
  272.     </_AfterCompileWinFXInternalDependsOn>
  273.  
  274.  
  275.   </PropertyGroup>
  276.     
  277.  
  278.   <!-- Work that we want to be done after the "Compile" target in Microsoft.Common.targets -->
  279.  
  280.   <Target Name="_AfterCompileWinFXInternal" DependsOnTargets="$(_AfterCompileWinFXInternalDependsOn)" />
  281.  
  282.   <!--
  283.     ===========================================================================================
  284.                                         AfterCompileWinFX
  285.  
  286.          Redefine this target in your project in order to run tasks just after WinFXCompile.
  287.     ===========================================================================================
  288.   -->
  289.  
  290.   <Target Name="AfterCompileWinFX"/>
  291.         
  292.    
  293.   <!-- 
  294.     Name : MarkupCompilePass1
  295.     This target generates code for every xaml file as well it also generates code for main and IResourceLoader.
  296.     This target uses MarkupCompilePass1 task.
  297.   -->
  298.  
  299.  
  300.   
  301.  
  302.   <!--
  303.   ================================================================
  304.                                    MarkupCompilePass1
  305.   ================================================================
  306.   -->
  307.  
  308.   <Target Name="MarkupCompilePass1"
  309.           DependsOnTargets="$(MarkupCompilePass1DependsOn)" 
  310.           Condition="'@(Page)@(ApplicationDefinition)' != '' " >
  311.  
  312.         <Message Text="(in) Page: '@(Page)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  313.         <Message Text="(in) ApplicationDefinition: '@(ApplicationDefinition)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  314.         <Message Text="(in) Resource: '@(Resource)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  315.         <Message Text="(in) CodeGenReference: '@(ReferencePath)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  316.       
  317.         <MarkupCompilePass1 
  318.                Language="$(Language)" 
  319.                UICulture="$(UICulture)"
  320.                ApplicationMarkup="@(ApplicationDefinition)"
  321.                LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
  322.                PageMarkup="@(Page)" 
  323.                ContentFiles="@(Content)"
  324.                AssemblyName="$(AssemblyName)"
  325.                OutputType="$(OutputType)" 
  326.                AssemblyVersion="$(AssemblyVersion)"
  327.                AssemblyPublicKeyToken="$(AssemblyPublicKeyToken)"
  328.                References="@(ReferencePath)" 
  329.                RootNamespace="$(RootNamespace)" 
  330.                KnownReferencePaths="$(MSBuildBinPath);@(_TargetFrameworkDirectoryItem);@(_TargetFrameworkSDKDirectoryItem);@(KnownReferencePaths)"
  331.                AssembliesGeneratedDuringBuild="@(AssembliesGeneratedDuringBuild)"
  332.                AlwaysCompileMarkupFilesInSeparateDomain="$(AlwaysCompileMarkupFilesInSeparateDomain)"
  333.                HostInBrowser="$(HostInBrowser)" 
  334.                LocalizationDirectivesToLocFile="$(LocalizationDirectivesToLocFile)"
  335.                ContinueOnError="false" 
  336.                SourceCodeFiles="@(Compile)"
  337.                DefineConstants="$(DefineConstants)"
  338.                ExtraBuildControlFiles="@(ExtraBuildControlFiles)"
  339.                XamlDebuggingInformation="$(XamlDebuggingInformation)"
  340.                OutputPath="$(IntermediateOutputPath)">
  341.  
  342.            
  343.               <Output ItemName="GeneratedBaml" TaskParameter="GeneratedBamlFiles"/>
  344.               <Output ItemName="GeneratedLocalizationFiles" TaskParameter="GeneratedLocalizationFiles" />
  345.               <Output PropertyName="_RequireMCPass2ForMainAssembly" TaskParameter="RequirePass2ForMainAssembly" />
  346.               <Output PropertyName="_RequireMCPass2ForSatelliteAssemblyOnly" TaskParameter="RequirePass2ForSatelliteAssembly" />
  347.               <Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" />
  348.  
  349.               <!-- Keep a list of all the generated files, it is used to clean up for a next clean build -->
  350.               <Output ItemName="FileWrites" TaskParameter="AllGeneratedFiles" />
  351.  
  352.               <Output ItemName="_GeneratedCodeFiles" 
  353.                       TaskParameter="GeneratedCodeFiles" />
  354.  
  355.  
  356.         </MarkupCompilePass1>
  357.         
  358.         
  359.         <Message Text="(out) GeneratedBamlFiles: '@(GeneratedBaml)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  360.         <Message Text="(out) SourceCodeFiles: '@(Compile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  361.         <Message Text="(Out) GeneratedCodeFiles: '@(_GeneratedCodeFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  362.         <Message Text="(out) GeneratedLocalizationFiles: @(GeneratedLocalizationFiles)" Condition="'$(MSBuildTargetsVerbose)'=='true'" />
  363.  
  364.        <Message Text="(out) _RequireMCPass2ForMainAssembly : '$(_RequireMCPass2ForMainAssembly)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  365.  
  366.        <Message Text="(out) _RequireMCPass2ForSatelliteAssemblyOnly : '$(_RequireMCPass2ForSatelliteAssemblyOnly)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  367.       
  368.   </Target>
  369.  
  370.   <!--
  371.  
  372.     ================================================================
  373.                                    MarkupCompilePass2
  374.     ================================================================
  375.   
  376.     Name: MarkupCompilePass2
  377.     
  378.     For those xaml files that contain local-implemented types, this target will invoke MarkupCompilePass2
  379.     task to compile those xaml files after the main assembly is generated.
  380.  
  381.     If MarkupCompilePass1 task is not invoked, that means there is no any Xaml input file change since last build,
  382.     and then it is not required to run this MarkupCompilePass2 either.
  383.  
  384.   -->
  385.   <Target Name="MarkupCompilePass2" 
  386.           Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)_MarkupCompile.lref')" >
  387.  
  388.         <Message Text="(in) References: '@(ReferencePath);@(AssemblyForLocalTypeReference)'"  Condition="'$(MSBuildTargetsVerbose)'=='true'" />
  389.  
  390.         <MarkupCompilePass2
  391.                AssemblyName="$(AssemblyName)" 
  392.                OutputType="$(OutputType)" 
  393.                Language="$(Language)" 
  394.                LocalizationDirectivesToLocFile="$(LocalizationDirectivesToLocFile)"
  395.                RootNamespace="$(RootNamespace)" 
  396.                References="@(ReferencePath);@(AssemblyForLocalTypeReference)" 
  397.                KnownReferencePaths="$(MSBuildBinPath);@(_TargetFrameworkDirectoryItem);@(_TargetFrameworkSDKDirectoryItem);@(KnownReferencePaths)"
  398.                AssembliesGeneratedDuringBuild="@(AssembliesGeneratedDuringBuild)"
  399.                AlwaysCompileMarkupFilesInSeparateDomain="$(AlwaysCompileMarkupFilesInSeparateDomain)"
  400.                XamlDebuggingInformation="$(XamlDebuggingInformation)"
  401.                GeneratedBaml="" 
  402.                OutputPath="$(IntermediateOutputPath)"
  403.                ContinueOnError="false" >
  404.  
  405.           <!-- 
  406.                Output Items for MarkupCompilePass2 
  407.  
  408.                If MarkupCompilePass2 is only for SatelliteAssembly, Append all the generated baml files into SatelliteEmbeddedFiles, No FileClassifier is required.
  409.                If MarupCompilePass2 is for Main Assembly as well, output the Baml files into GeneratedBaml, FileClassifier task will be invoked later.
  410.           -->           
  411.   
  412.    
  413.             <Output ItemName="GeneratedBamlWithLocalType" 
  414.                     TaskParameter="GeneratedBaml" 
  415.                     Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  416.  
  417.             <Output ItemName="GeneratedBaml" 
  418.                     TaskParameter="GeneratedBaml" 
  419.                     Condition="'$(_RequireMCPass2ForMainAssembly)' == 'true'" />
  420.  
  421.             <Output ItemName="SatelliteEmbeddedFiles" 
  422.                     TaskParameter="GeneratedBaml" 
  423.                     Condition="'$(_RequireMCPass2ForSatelliteAssemblyOnly)' == 'true'" />
  424.  
  425.  
  426.             <!-- Put the generated files in item FileWrites so that they can be cleaned up appropriately in a next Rebuild -->
  427.  
  428.             <Output ItemName="FileWrites" TaskParameter="GeneratedBaml" />
  429.  
  430.         </MarkupCompilePass2>
  431.  
  432.         <Message Text="(out) After MarkupCompilePass2, SatelliteEmbeddedFiles: '@(SatelliteEmbeddedFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  433.         <Message Text="(out) GeneratedBamlWithLocalType: '@(GeneratedBamlWithLocalType)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  434.  
  435.   </Target>
  436.  
  437.  <!--
  438.  
  439.     ================================================================
  440.                                    MarkupCompilePass2ForMainAssembly
  441.     ================================================================
  442.   
  443.         Name : MarkupCompilePass2ForMainAssembly
  444.  
  445.         This target is invoked only when there is a xaml file which references local-type and is to embed into main assembly.
  446.         It is possible when UICulture is not set, or the xaml file has explicitly set Localizable metadata to false.
  447.  
  448.         Condition: _RequireMCPass2ForMainAssembly == true
  449.  
  450.   -->
  451.  
  452.   <PropertyGroup>
  453.          
  454.        <MarkupCompilePass2ForMainAssemblyDependsOn>
  455.                      GenerateTemporaryTargetAssembly;
  456.                      MarkupCompilePass2;
  457.                      CleanupTemporaryTargetAssembly
  458.        </MarkupCompilePass2ForMainAssemblyDependsOn>
  459.  
  460.        <_CompileTargetNameForLocalType Condition="'$(_CompileTargetNameForLocalType)' == ''">_CompileTemporaryAssembly</_CompileTargetNameForLocalType>
  461.  
  462.  
  463.   </PropertyGroup>
  464.  
  465.   <Target Name="_CompileTemporaryAssembly"  DependsOnTargets="BuildOnlySettings;ResolveKeySource;CoreCompile" />
  466.  
  467.  
  468.   <Target Name="MarkupCompilePass2ForMainAssembly" 
  469.                Condition="'$(_RequireMCPass2ForMainAssembly)' == 'true' "
  470.                DependsOnTargets="$(MarkupCompilePass2ForMainAssemblyDependsOn)" >
  471.  
  472.   </Target>
  473.  
  474.  
  475.   <!--
  476.  
  477.                 ==========================================
  478.                        GenerateTemporaryTargetAssembly
  479.                 ==========================================
  480.   
  481.                 Name : GenerateTemporaryTargetAssembly
  482.  
  483.   -->
  484.  
  485.    <Target Name="GenerateTemporaryTargetAssembly" 
  486.                Condition="'$(_RequireMCPass2ForMainAssembly)' == 'true' " >
  487.  
  488.       <Message Text="MSBuildProjectFile is $(MSBuildProjectFile)" Condition="'$(MSBuildTargetsVerbose)' == 'true'" />
  489.  
  490.        <GenerateTemporaryTargetAssembly
  491.                 CurrentProject="$(MSBuildProjectFullPath)"
  492.                 MSBuildBinPath="$(MSBuildBinPath)"
  493.                 ReferencePathTypeName="ReferencePath"
  494.                 CompileTypeName="Compile"
  495.                 GeneratedCodeFiles="@(_GeneratedCodeFiles)" 
  496.                 ReferencePath="@(ReferencePath)"
  497.                 IntermediateOutputPath="$(IntermediateOutputPath)"
  498.                 AssemblyName="$(AssemblyName)"
  499.                 CompileTargetName="$(_CompileTargetNameForLocalType)"
  500.                  >
  501.  
  502.        </GenerateTemporaryTargetAssembly>
  503.  
  504.        <CreateItem Include="$(IntermediateOutputPath)$(TargetFileName)" >
  505.                <Output TaskParameter="Include" ItemName="AssemblyForLocalTypeReference" />
  506.        </CreateItem>
  507.  
  508.   </Target>
  509.  
  510.  
  511.   <!--
  512.  
  513.                  ===========================================
  514.                           CleanupTemporaryTargetAssembly
  515.                  ===========================================
  516.   
  517.                 Name : CleanupTemporaryTargetAssembly
  518.  
  519.   -->
  520.  
  521.   <Target Name="CleanupTemporaryTargetAssembly" >
  522.  
  523.          <Message Text="Remove the temporary project and target assembly" Condition="'$(MSBuildTargetsVerbose)'=='true'" />
  524.  
  525.          <Delete Files="@(AssemblyForLocalTypeReference)"
  526.                      Condition="Exists('%(Fullpath)')" />
  527.  
  528.   </Target>
  529.  
  530.  
  531.  
  532. <!--
  533.  
  534.     ================================================================
  535.                                    SatelliteOnlyMarkupCompilePass2
  536.     ================================================================
  537.   
  538.         Name : SatelliteOnlyMarkupCompilePass2
  539.  
  540.         This target is invoked only when there is a xaml file which references local-type and no such xaml file is going
  541.          to be embedded into main assembly.
  542.  
  543.         Condition: _RequireMCPass2ForSatelliteAssemblyOnly == true
  544.  
  545.   -->
  546.  
  547.  
  548.   <Target Name="AddIntermediateAssemblyToReferenceList" >
  549.  
  550.           <CreateItem Include="@(IntermediateAssembly)" >
  551.                <Output TaskParameter="Include" ItemName="AssemblyForLocalTypeReference" />
  552.           </CreateItem>
  553.  
  554.   </Target>
  555.  
  556.   <Target Name="SatelliteOnlyMarkupCompilePass2"  Condition="'$(_RequireMCPass2ForSatelliteAssemblyOnly)' == 'true'"  
  557.                DependsOnTargets="AddIntermediateAssemblyToReferenceList;MarkupCompilePass2" >
  558.   </Target>
  559.  
  560.  
  561.  
  562.   <!--
  563.          ============ Manifest Generation Related Properties, Targets ==============
  564.   -->
  565.  
  566.   <PropertyGroup Condition="'$(IsApplication)' == 'true'" >
  567.  
  568.     <!--
  569.          Default settings which are required by Manifest generation.
  570.     -->
  571.  
  572.     <!-- 
  573.  
  574.         For a regular ClickOnce application, GenerateManifests depends on targets :
  575.              GenerateApplicationManifest; and GenerateDeploymentManifest
  576.  
  577.         For a WinFX application, Two special issues have differnet dependsOn targets
  578.  
  579.          A.  For a HostInBrowser application.
  580.          B.  For a ClickOnce application with SignManifests set to true.
  581.  
  582.      -->
  583.  
  584.     <WinFXGenerateManifestsDependsOn>
  585.          GenerateApplicationManifest;
  586.          GenerateDeploymentManifest
  587.     </WinFXGenerateManifestsDependsOn>
  588.  
  589.  
  590.     <WinFXGenerateManifestsDependsOn Condition="'$(SignManifests)' == 'true'" >
  591.          GenerateApplicationManifest;
  592.          ResignApplicationManifest;
  593.          GenerateDeploymentManifest;
  594.          SignDeploymentManifest
  595.     </WinFXGenerateManifestsDependsOn>
  596.  
  597.     <!--
  598.         The GenerateApplicationManifest task doesn't put the dependent assembly's 
  599.         satellite assembly to the manifest record if the satellite assembly's culture 
  600.         is not same as main application project's UICulture setting.
  601.         To workaround the limitation of the task design, WinFX project sets the default
  602.         value '*' to TargetCulture.
  603.     -->
  604.  
  605.     <TargetCulture Condition="'$(TargetCulture)'==''">*</TargetCulture>
  606.     <FallbackCulture Condition="'$(UICulture)'!=''">$(UICulture)</FallbackCulture>
  607.     
  608.   </PropertyGroup>
  609.  
  610.   <PropertyGroup Condition="'$(HostInBrowser)' == 'true' and '$(IsApplication)' == 'true'" >
  611.  
  612.      <!-- Set default value for some related properties -->
  613.  
  614.      <!-- For Browser application, GenerateManifests depends on different targets. -->
  615.      <WinFXGenerateManifestsDependsOn>
  616.              HostInBrowserValidation;
  617.              GenerateApplicationManifest;
  618.              UpdateBrowserApplicationManifest;
  619.              ResignApplicationManifest;
  620.              GenerateDeploymentManifest;
  621.              SignDeploymentManifest
  622.      </WinFXGenerateManifestsDependsOn>
  623.  
  624.  
  625.      <GenerateManifests Condition="'$(GenerateManifests)' == ''" >true</GenerateManifests>
  626.      <GenerateClickOnceManifests Condition="'$(GenerateClickOnceManifests)' == ''">$(GenerateManifests)</GenerateClickOnceManifests>
  627.  
  628.      <!-- 
  629.          If 'install' is not set in project file, set it to false here.
  630.          But if 'install' is set in project, don't change it now. Later
  631.          the PropertyValidation target will check if it is correct or not.
  632.      --> 
  633.  
  634.      <Install Condition="'$(Install)'==''">false</Install>
  635.  
  636.      <!-- 
  637.          The valid values for TargetZone are :
  638.               Internet, Intranet, LocalMachine, Custom 
  639.  
  640.          User can set all above vaild values in project file.
  641.  
  642.          If this property is not set in project, for HostInBrowser, 
  643.          we set default value 'Internet' here.
  644.      -->
  645.  
  646.      <TargetZone Condition="'$(TargetZone)' == ''">Internet</TargetZone>
  647.  
  648.  
  649.      <!-- Change the deploy file exension for HostInBrowser application. -->
  650.  
  651.      <HostInBrowserExtension>.xbap</HostInBrowserExtension>
  652.  
  653.  
  654.      <!-- 
  655.         Overwrite below properties which have been set in Microsoft.Common.targets.
  656.      -->
  657.  
  658.      <TargetDeployManifestFileName>$(AssemblyName)$(HostInBrowserExtension)</TargetDeployManifestFileName>
  659.      <TargetUrl Condition="'$(TargetUrl)'!=''">$(TargetUrl)/$(TargetDeployManifestFileName)</TargetUrl>
  660.      <DeployManifestIdentity>$(ManifestIdentity)$(HostInBrowserExtension)</DeployManifestIdentity>
  661.      <StartArguments Condition="'$(StartArguments)' == ''">-debug  "$(MSBuildProjectDirectory)\bin\$(Configuration)\$(AssemblyName).xbap"</StartArguments>
  662.      <StartArguments Condition="'$(DebugSecurityZoneURL)'!=''">$(StartArguments) -DebugSecurityZoneURL "$(DebugSecurityZoneURL)"</StartArguments>
  663.  
  664.   </PropertyGroup>
  665.  
  666.   <!--
  667.       ================================================================
  668.                                    GenerateManifests
  669.       ================================================================
  670.  
  671.       Override GenerateManifests target in Microsoft.Common.targets.
  672.  
  673.       Inject WinFX specific manifest related targets at right stages.      
  674.   -->
  675.  
  676.   <Target
  677.         Name="GenerateManifests"
  678.         Condition="'$(HostInBrowser)' == 'true' or '$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!=''"
  679.         DependsOnTargets="$(WinFXGenerateManifestsDependsOn)" />
  680.  
  681.  
  682.   <!-- 
  683.       Do some property value check before the real manifest generation task starts. 
  684.  
  685.       WinFX.targets should care about the property setting for Browser application only.
  686.  
  687.       For a regular ClickOnce application, Microsoft.Common.targets is responsible for 
  688.       the setting validation.
  689.   -->
  690.  
  691.   <Target Name="HostInBrowserValidation" Condition="'$(HostInBrowser)' == 'true'" >
  692.  
  693.      <Message Text="(in) Install: '$(Install)'" Condition="'$(MSBuildTargetsVerbose)' == 'true'" />
  694.  
  695.      <!-- 
  696.          TODO: Will get error message from Build task resource so that the message is 
  697.          localizable and can be set an unique error ID.
  698.      -->
  699.  
  700.      <Error Condition="'$(GenerateManifests)' != 'true'" Text="Property GenerateManifests should not be set a value other than true for a browser application." />
  701.  
  702.      <Error  Condition="'$(Install)' == 'true'" Text="Property Install and HostInBrowser should not be both set to true." /> 
  703.  
  704.      <Error Condition="'$(SignManifests)' != 'true' or '$(ManifestKeyFile)' == '' or '$(ManifestCertificateThumbprint)' == ''" Text="The ClickOnce manifest for XAML Browser Applications must always be signed. You must specify properties: SignManifests (value set to True), ManifestKeyFile (with the name of your key file) and ManifestCertificateThumbprint (hexadecimal thumbprint value in SHA-1 format, of key file). Alternatively, you may use your IDE's Publish Wizard or Signing options." />
  705.  
  706.       <Error Condition=" '$(PlatformTarget)' != '' and '$(PlatformTarget)' != 'AnyCpu' "
  707.              Text="Cannot build a platform-specific XAML Browser Application. If HostInBrowser property is set to 'True', either do not set the PlatformTarget property or set it to 'AnyCpu'." />
  708.  
  709.  
  710.   </Target>
  711.  
  712.  
  713.   <Target Name="UpdateBrowserApplicationManifest" Condition="'$(HostInBrowser)' == 'true'" >
  714.  
  715.         <!-- 
  716.             Update application manifest for browser hosted entry point 
  717.         -->
  718.  
  719.         <UpdateManifestForBrowserApplication
  720.             ApplicationManifest="@(ApplicationManifest)"
  721.             HostInBrowser="$(HostInBrowser)"
  722.             />
  723.         
  724.   </Target>
  725.  
  726.   <!-- 
  727.          Resign Application Manifest after update. 
  728.          _DeploymentResolvedManifestCertificateThumbprint property is set only when SignManifest is set to true.
  729.    -->
  730.   <Target Name="ResignApplicationManifest" Condition="'$(_DeploymentResolvedManifestCertificateThumbprint)'!= ''" >
  731.  
  732.        <Message Text="(in) ApplicationManifest: '@(ApplicationManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  733.        <Message Text="(in) ManifestKeyFile: '$(ManifestKeyFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  734.        <Message Text="(in) _DeploymentResolvedManifestCertificateThumbprint: '$(_DeploymentResolvedManifestCertificateThumbprint)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  735.  
  736.         <SignFile
  737.             CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  738.             TimestampUrl="$(ManifestTimestampUrl)"
  739.             SigningTarget="@(ApplicationManifest)"/>
  740.        
  741.   </Target>
  742.  
  743.  
  744.   <!--
  745.          Sign Deployment Manifest if SignManifest is set to true.  
  746.          _DeploymentResolvedManifestCertificateThumbprint property is set only when SignManifest is set to true.
  747.   --> 
  748.   <Target Name="SignDeploymentManifest" Condition=" '$(_DeploymentResolvedManifestCertificateThumbprint)' != '' " >
  749.  
  750.        <Message Text="(in) DeployManifest: '@(DeployManifest)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  751.        <Message Text="(in) ManifestKeyFile: '$(ManifestKeyFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  752.        <Message Text="(in) _DeploymentResolvedManifestCertificateThumbprint: '$(_DeploymentResolvedManifestCertificateThumbprint)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  753.  
  754.         <SignFile
  755.             CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  756.             TimestampUrl="$(ManifestTimestampUrl)"
  757.             SigningTarget="@(DeployManifest)"/> 
  758.  
  759.   </Target>
  760.  
  761.  
  762.   <!-- 
  763.       ================================================================
  764.                                    FileClassification
  765.       ================================================================
  766.  
  767.      Classify baml and image files into different groups for Main assembly and satellite assembly respectively.
  768.  
  769.   -->
  770.   <Target Name="FileClassification">
  771.  
  772.       <FileClassifier Condition="'@(GeneratedBaml)@(Resource)@(Font)' != ''"
  773.                       SourceFiles="@(GeneratedBaml);@(Resource);@(Font)" 
  774.                       Culture="$(UICulture)" 
  775.                       OutputType="$(OutputType)" 
  776.                       MainEmbeddedFiles="@(MainEmbeddedFiles)" 
  777.                       SatelliteEmbeddedFiles="@(SatelliteEmbeddedFiles)" 
  778.                       CLREmbeddedResource="@(CLREmbeddedResources)" 
  779.                       CLRSatelliteEmbeddedResource="@(CLRSatelliteEmbeddedResources)" 
  780.                       CLRResourceFiles="@(CLRResources)" >
  781.  
  782.           <Output ItemName="MainEmbeddedFiles" TaskParameter="MainEmbeddedFiles" />
  783.           <Output ItemName="SatelliteEmbeddedFiles" TaskParameter="SatelliteEmbeddedFiles" />
  784.           <Output ItemName="WinFXEmbeddedResource" TaskParameter="CLREmbeddedResource" />
  785.           <Output ItemName="WinFXEmbeddedResource" TaskParameter="CLRSatelliteEmbeddedResource" />
  786.  
  787.       </FileClassifier>
  788.       
  789.         <Message Text="(out) EmbeddedFiles: '@(MainEmbeddedFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  790.         <Message Text="(out) SatelliteEmbeddedFiles: '@(SatelliteEmbeddedFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  791.  
  792.   </Target>
  793.  
  794.   <!--
  795.       ================================================================
  796.                                    MainResourcesGeneration
  797.       ================================================================
  798.  
  799.   -->
  800.  
  801.   <PropertyGroup>
  802.  
  803.      <!-- 
  804.           If the UICulture is not set, resources will be embedded into main assembly.
  805.           keep $(AssemblyName).g.resources as resource name for this scenario.
  806.           
  807.           If the UICulture is set to some culture, all the localizable resources will 
  808.           be embedded into satellite assembly, and all the non-localizable resources
  809.           will be embedded into main assembly.  for this scenario,  keep
  810.  
  811.               $(AssemblyName).g for localizable resources, 
  812.               $(AssemblyName).unlocalizable.g for unlocalizable resources
  813.       -->
  814.  
  815.  
  816.      <_ResourceNameInMainAssembly Condition="'$(UICulture)' == ''">$(AssemblyName).g.resources</_ResourceNameInMainAssembly>
  817.  
  818.      <_ResourceNameInMainAssembly Condition="'$(UICulture)' != ''">$(AssemblyName).unlocalizable.g.resources</_ResourceNameInMainAssembly>
  819.   
  820.   
  821.   </PropertyGroup>
  822.  
  823.  
  824.   <Target Name="MainResourcesGeneration" Inputs="@(MainEmbeddedFiles)" Outputs="$(IntermediateOutputPath)$(_ResourceNameInMainAssembly) ">
  825.  
  826.     <!--
  827.         This generates .resources file containing all the resources that are to be 
  828.         embedded in the main assembly and dont need to be localized
  829.     -->
  830.       
  831.     <Message Text="(in) EmbeddedFiles: '@(MainEmbeddedFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  832.       
  833.     <ResourcesGenerator 
  834.                    ResourceFiles="@(MainEmbeddedFiles)" 
  835.                    OutputPath="$(IntermediateOutputPath)" 
  836.                    OutputResourcesFile="$(IntermediateOutputPath)$(_ResourceNameInMainAssembly)" 
  837.                    Condition="'@(MainEmbeddedFiles)' != ''">
  838.  
  839.           <Output ItemName="ManifestResourceWithNoCulture" TaskParameter="OutputResourcesFile" />
  840.  
  841.           <!-- Put the generated files in item FileWrites so that they can be cleaned up appropriately in a next Rebuild -->
  842.           <Output ItemName="FileWrites" TaskParameter="OutputResourcesFile" />
  843.  
  844.  
  845.     </ResourcesGenerator>
  846.  
  847.   </Target>
  848.  
  849.   <!-- 
  850.  
  851.        ================================================================
  852.                                    SatelliteResourceGeneration
  853.        ================================================================
  854.  
  855.        This target just takes the SatelliteEmbeddedFiles such as .baml, images, fonts. etc
  856.        But not any $(Culture).resx and .resText etc.  those files should have been handled by 
  857.        PrepareResource target.
  858.  
  859.        This target should output Item ManifestResourceWithCulture, which is then taken by 
  860.        CreateSatelliteAssemblies target.
  861.   -->
  862.  
  863.   <Target Name="SatelliteResourceGeneration" 
  864.           Condition="'$(UICulture)' != ''" 
  865.           Inputs="@(SatelliteEmbeddedFiles)" 
  866.           Outputs="$(IntermediateOutputPath)$(AssemblyName).g.$(UICulture).resources">
  867.  
  868.       <!--
  869.         This generates .resources file containing all the resources that are to be embedded 
  870.         in the satellite  assembly and need to be localized. 
  871.  
  872.         This task only runs if the default culture of the build is not NULL
  873.       -->
  874.       
  875.       <Message Text="(in) SatelliteEmbeddedFiles: '@(SatelliteEmbeddedFiles)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  876.  
  877.       <ResourcesGenerator 
  878.                      ResourceFiles="@(SatelliteEmbeddedFiles)" 
  879.                      OutputPath="$(IntermediateOutputPath)" 
  880.                      OutputResourcesFile="$(IntermediateOutputPath)$(AssemblyName).g.$(UICulture).resources" 
  881.                      Condition="'@(SatelliteEmbeddedFiles)'!=''">
  882.  
  883.             <Output ItemName="_SatelliteResourceFile" TaskParameter="OutputResourcesFile" />
  884.  
  885.             <!-- Put the generated files in item FileWrites so that they can be cleaned up appropriately in a next Rebuild -->
  886.             <Output ItemName="FileWrites" TaskParameter="OutputResourcesFile" />
  887.  
  888.  
  889.       </ResourcesGenerator>
  890.  
  891.       <Message Text="(out) _SatelliteResourceFile is '@(_SatelliteResourceFile)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  892.  
  893.   </Target>
  894.  
  895.   <!--
  896.       This target should always run after SatelliteResourceGeneration, so that it 
  897.       can generate the correct Item which contains right Culture attribute even for 
  898.       incremental build.
  899.   -->
  900.  
  901.   <Target Name="GenerateResourceWithCultureItem" Condition="'$(UICulture)' != ''" >
  902.  
  903.       <CreateItem
  904.             Include="@(_SatelliteResourceFile)"
  905.             AdditionalMetadata="Culture=$(UICulture)"
  906.             >
  907.  
  908.             <Output TaskParameter="Include" ItemName="ManifestResourceWithCulture" />
  909.  
  910.       </CreateItem>
  911.  
  912.       <Message Text="(out) ManifestResourceWithCulture: '@(ManifestResourceWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
  913.  
  914.   </Target>
  915.  
  916.  
  917.   <!-- Overwrite some target and properties for Publish support -->
  918.  
  919.    <!--  
  920.          PublishBuildDependsOn property is defined in Microsoft.Common.targets, but it doesn't handle WinFX 
  921.          resx file, since this resx file is not set into project file, but is generated at build time.
  922.  
  923.          For Publish Build, we need to make sure the $(Target).g.$(UICulture).resources is handled correctly.
  924.          Add target "PrepareResourcesForSatelliteAssemblies" to the place prior to CreateSatelliteAssemblies.
  925.     -->
  926.     <PropertyGroup>
  927.         <PublishBuildDependsOn>
  928.             BuildOnlySettings;
  929.             PrepareForBuild;
  930.             ResolveReferences;
  931.             PrepareResources;
  932.             ResolveKeySource;
  933.             PrepareResourcesForSatelliteAssemblies;
  934.             GenerateSerializationAssemblies;
  935.             CreateSatelliteAssemblies;
  936.         </PublishBuildDependsOn>
  937.     </PropertyGroup>
  938.  
  939.    <!--  
  940.          SatelliteDllsProjectOutputGroup target is implemented in Microsoft.Common.targets, but it doesn't handle WinFX 
  941.          satellite assembly, since for WinFX, the $(targetname).g.$(UICulture).resx is not set into project file, but is generated 
  942.          at build time after Xaml file is compiled, (for some case, it is generated after the main dll is compiled).
  943.  
  944.         So overwrite this target, copy the content from Microsoft.Common.targets and inject the part for our UICulture support.
  945.  
  946.     -->
  947.  
  948.     <!--
  949.     ================================================================
  950.                                          SatelliteDllsProjectOutputGroup
  951.     ================================================================
  952.  
  953.     This target performs population of the Satellite Files project output group.
  954.     -->
  955.     <Target
  956.         Name="SatelliteDllsProjectOutputGroup"
  957.         DependsOnTargets="PrepareResourceNames"
  958.         Outputs="@(SatelliteDllsProjectOutputGroupOutput)">
  959.  
  960.         <CreateItem
  961.             Include="$(IntermediateOutputPath)%(ResxWithCulture.Culture)\$(TargetName).resources.dll"
  962.             AdditionalMetadata="TargetPath=%(ResxWithCulture.Culture)\$(TargetName).resources.dll"
  963.             Condition="'@(ResxWithCulture)' != ''">
  964.  
  965.            <Output ItemName="SatelliteDllsProjectOutputGroupOutputIntermediate" TaskParameter="Include" />
  966.  
  967.         </CreateItem>
  968.  
  969.         <!--  This task is WinFX specific. -->
  970.  
  971.         <CreateItem
  972.             Include="$(IntermediateOutputPath)$(UICulture)\$(TargetName).resources.dll"
  973.             AdditionalMetadata="TargetPath=$(UICulture)\$(TargetName).resources.dll"
  974.             Condition="'$(UICulture)' != ''">
  975.  
  976.            <Output ItemName="SatelliteDllsProjectOutputGroupOutputIntermediate" TaskParameter="Include" />
  977.  
  978.         </CreateItem>
  979.   
  980.         <!-- End of WinFX specific -->
  981.  
  982.         <CreateItem
  983.             Include="$(IntermediateOutputPath)%(NonResxWithCulture.Culture)\$(TargetName).resources.dll"
  984.             AdditionalMetadata="TargetPath=%(NonResxWithCulture.Culture)\$(TargetName).resources.dll"
  985.             Condition="'@(NonResxWithCulture)' != ''">
  986.  
  987.             <Output ItemName="SatelliteDllsProjectOutputGroupOutputIntermediate" TaskParameter="Include" />
  988.  
  989.         </CreateItem>
  990.  
  991.         <CreateItem Include="$(IntermediateOutputPath)">
  992.             <Output ItemName="SatelliteDllsProjectOutputGroupRootRelativeUrlBaseIntermediate" TaskParameter="Include"/>
  993.         </CreateItem>
  994.  
  995.         <!-- Convert intermediate items into final items; this way we can get the full path for each item. -->
  996.         <CreateItem Include="@(SatelliteDllsProjectOutputGroupOutputIntermediate->'%(FullPath)')">
  997.             <Output ItemName="SatelliteDllsProjectOutputGroupOutput" TaskParameter="Include"/>
  998.         </CreateItem>
  999.  
  1000.     </Target>
  1001.  
  1002.  
  1003.   <!-- Other Targets  -->
  1004.   <Target Name="CheckUid" 
  1005.           Condition="'@(Page)@(ApplicationDefinition)'!=''">
  1006.  
  1007.        <UidManager MarkupFiles="@(Page);@(ApplicationDefinition)" Task="Check" />
  1008.  
  1009.   </Target>
  1010.  
  1011.   <Target Name="UpdateUid" 
  1012.           Condition="'@(Page)@(ApplicationDefinition)'!=''">
  1013.  
  1014.       <UidManager MarkupFiles="@(Page);
  1015.                                @(ApplicationDefinition)" 
  1016.                   IntermediateDirectory ="$(IntermediateOutputPath)"
  1017.                   Task="Update" />
  1018.  
  1019.   </Target>
  1020.  
  1021.   <Target Name="RemoveUid" 
  1022.           Condition="'@(Page)@(ApplicationDefinition)'!=''">
  1023.       <UidManager MarkupFiles="@(Page);
  1024.                                @(ApplicationDefinition)"
  1025.                                
  1026.                   IntermediateDirectory ="$(IntermediateOutputPath)"
  1027.                   Task="Remove" />
  1028.  
  1029.   </Target>
  1030.  
  1031.   <!-- 
  1032.       ================================================================
  1033.                                   MergeLocalizationDirectives
  1034.       ================================================================
  1035.  
  1036.       Merge localization comments of single bamls into one file for the whole assembly. 
  1037.  
  1038.   -->
  1039.   <Target Name="MergeLocalizationDirectives"
  1040.           Condition="'@(GeneratedLocalizationFiles)' !=''"
  1041.           Inputs="@(GeneratedLocalizationFiles)"
  1042.           Outputs="$(IntermediateOutputPath)$(AssemblyName).loc" 
  1043.   >
  1044.        <MergeLocalizationDirectives GeneratedLocalizationFiles="@(GeneratedLocalizationFiles)"
  1045.                                     OutputFile="$(IntermediateOutputPath)$(AssemblyName).loc"/>
  1046.  
  1047.        <!-- 
  1048.           Add the merged loc file into _NoneWithTargetPath so that it will be copied to the 
  1049.           output directory
  1050.        --> 
  1051.        <CreateItem Condition="Exists('$(IntermediateOutputPath)$(AssemblyName).loc')"
  1052.                    Include="$(IntermediateOutputPath)$(AssemblyName).loc"
  1053.                    AdditionalMetadata="CopyToOutputDirectory=PreserveNewest; TargetPath=$(AssemblyName).loc" >
  1054.            <Output ItemName="_NoneWithTargetPath" TaskParameter="Include"/>
  1055.            <Output ItemName="FileWrites" TaskParameter="Include"/>
  1056.  
  1057.        </CreateItem>
  1058.        
  1059.   </Target>   
  1060.  
  1061.   <!-- End of other targets -->
  1062.  
  1063.   <!--
  1064.      This is similar to AssignTargetPaths target in Microsoft.Common.targets.
  1065.      But it handles only the generated WinFXEmbeddedResource item type.
  1066.  
  1067.      After this target is done, SplitResourceByCulture target can take the right input
  1068.      and handle the resource correctly.
  1069.   -->
  1070.   <Target Name="AssignWinFXEmbeddedResource" 
  1071.           Condition="'@(WinFXEmbeddedResource)' != ''" >
  1072.  
  1073.      <AssignTargetPath Files="@(WinFXEmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
  1074.             <Output TaskParameter="AssignedFiles" ItemName="_EmbeddedResourceWithTargetPath" />
  1075.      </AssignTargetPath>
  1076.  
  1077.   </Target>
  1078.   <!-- End of the project file, Do not add any more propeties, items, targets etc. -->
  1079.  
  1080.  
  1081. </Project>
  1082.